package main

import "fmt"

//func slice_sum(arr []int) (sum int, avg float64) {
//	sum = 0
//	avg = 0.0
//	for _, val := range arr {
//		sum += val
//	}
//	avg = float64(sum) / float64(len(arr))
//	//return sum, avg
//	return
//}

//func sum(arr ...int) int {
//	sum := 0
//	for _, val := range arr {
//		sum += val
//	}
//	return sum
//}

func main() {
	//var x = []int{1, 2, 3, 4, 6}

	//var y = []int{1, 2, 3, 45, 6, 7, 8}

	//fmt.Println(slice_sum(x))
	//fmt.Println(slice_sum(y))
	//fmt.Println(sum(1, 2, 3, 4))

	var arr1 = []int{1, 2, 3, 4, 5}
	var base = 300
	var sum = func(arr ...int) int {
		total := 0
		total += base
		for _, val := range arr {
			total += val
		}
		return total
	}

	fmt.Println(sum(arr1...))

}
